<?php
/**
 * JoiGallery - image gallery component for Joostina
 *
 * Мастер создания эскизов
 *
 * @version 1.0 alpha 12
 * @package JoiGallery
 * @subpackage	AdminView
 * @filename thumbs_form.php
 * @author JoostinaTeam
 * @copyright (C) 2008-2009 Joostina Team
 * @license see license.txt
 *
 **/
 
defined('_VALID_MOS') or die();

//Загружаем jQuery
mosCommonHTML::loadJquery();
//Загружаем плагин jQuery alphanumeric.js (контроль ввода символов)
$mainframe->addJS(JPATH_SITE.'/components/'.$option.'/js/alphanumeric.js');
	   
?>


<script language="javascript" type="text/javascript">
  function submitbutton(pressbutton) {
      var form = document.adminForm;
      // if (pressbutton == 'cancel') {
              // submitform( pressbutton );
              // return;
      // }
      if (pressbutton == 'thumbuild') {              
              // if (!$('#name').val()) {
                // alert('<?php echo _C_JOIGALLERY_MSG_SAVE_ERR_IMG_NAME_EMPTY; ?>');
                // $("form").submit(function () { return false; });
              // }
              // else {
                <?php //getEditorContents( 'editor1', 'description' ) ; ?>
                submitform(pressbutton);
              //}
      }
      
  }
  
</script>


<table class="adminheading">
  <tr>
    <th class="config">
     <?php echo _C_JOIGALLERY_COMPONENT;
           echo _C_JOIGALLERY_THUMB_MASTER.'&nbsp;<span class="red">в разработке</span>';
      ?>
    </th>
  </tr>
  <tr>
    <td class="red"> <span class="gray">Сейчас «мастер» может восстановить директории и создать файлы средних и мини-эскизов <br/>из оригиналов изображений конкретной категории, согласно настройкам конфигурации <b>default</b>.</td>
  </tr>
</table>

<form action="index2.php" method="post" name="adminForm" id="adminForm">
  
  <table class="adminform">
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td class="pl20" width="200"><?php echo _C_JOIGALLERY_CATEGORY ?>:</td>
      <td><?php echo $lists['cid']; ?></td>
    </tr>
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
  </table>

  <table class="adminform nodisplay">
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td class="pl20 bold" width="200"><?php echo _C_JOIGALLERY_RESIZED ?></td>
      <td><input type="checkbox" id="settings_resized" name="settings_resized" value="0"/></td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>
  </table>

  <table class="settings_resized adminform" style="display:none;">
    <tr>
      <td class="pl20" width="200"><?php echo _C_JOIGALLERY_CONF_IMAGE_MAX_WIDTH ?></td>
      <td><input type="text" name="max_width" class="numeric text_area w30px" maxlength="4" size="10" value="<?php echo $params->max_width; ?>" />&nbsp;<span style="color:#999;"><?php echo _C_JOIGALLERY_PX ?></span></td>
    </tr>
    <tr>
      <td class="pl20"><?php echo _C_JOIGALLERY_CONF_IMAGE_MAX_HEIGHT ?></td>
      <td><input type="text" name="max_height" class="numeric text_area w30px" maxlength="4" size="10" value="<?php echo $params->max_height; ?>" />&nbsp;<span style="color:#999;"><?php echo _C_JOIGALLERY_PX ?></span></td>
    </tr>
    <tr>
      <td class="pl20 pt10"><?php echo _C_JOIGALLERY_CONF_IMG_CROP ?></td>
      <td class="pt10"><?php echo mosHTML::yesnoRadioList('image_crop', 'class="inputbox"', $params->image_crop); ?></td>
    </tr>
    <tr>
      <td class="pl20"><?php echo _C_JOIGALLERY_CONF_IMG_WATERMARK_ADD ?> <?php echo mosToolTip(_C_JOIGALLERY_FILE.' middle.png'); ?></td>
      <td><?php echo mosHTML::yesnoRadioList('image_watermark', 'class="inputbox"', $params->image_watermark); ?></td>
    </tr>
    <tr>
      <td class="pl20 pt10"><?php echo _C_JOIGALLERY_CONF_IMG_WATERMARK_POSITION ?></td>
      <td class="pt10"><?php echo mosHTML::selectList($list['watermak_position'] , 'image_watermark_position', 'class="inputbox"', 'value', 'text', $params->image_watermark_position); ?></td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>
  </table>
  <?php //style="border-bottom:thin solid #999" //background:#f2f2f2"?>

  <table class="adminform nodisplay">
    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td class="pl20 bold" width="200"><?php echo _C_JOIGALLERY_THUMBS ?></td>
      <td><input type="checkbox" id="settings_thumb" name="settings_thumb" value="0"/></td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>
  </table>

  <table class="settings_thumb adminform" style="display:none;">
    <tr>
      <td class="pl20" width="200"><?php echo _C_JOIGALLERY_CONF_THUMBNAIL_WIDTH ?></td>
      <td><input type="text" name="thumbnail_width" class="numeric text_area w25px" maxlength="3" size="10" value="<?php echo $params->thumbnail_width; ?>" />&nbsp;<span style="color:#999;"><?php echo _C_JOIGALLERY_PX ?></span></td>
    </tr>
    <tr>
      <td class="pl20"><?php echo _C_JOIGALLERY_CONF_THUMBNAIL_HEIGHT ?></td>
      <td><input type="text" name="thumbnail_height" class="numeric text_area w25px" maxlength="3" size="10" value="<?php echo $params->thumbnail_height; ?>" />&nbsp;<span style="color:#999;"><?php echo _C_JOIGALLERY_PX ?></span></td>
    </tr>
    <tr>
      <td class="pl20 pt10"><?php echo _C_JOIGALLERY_CONF_IMG_CROP ?></td>
      <td class="pt10"><?php echo mosHTML::yesnoRadioList('thumb_crop', 'class="inputbox"', $params->thumb_crop); ?></td>
    </tr>
    <tr>
      <td class="pl20"><?php echo _C_JOIGALLERY_CONF_IMG_WATERMARK_ADD ?></td>
      <td><?php echo mosHTML::yesnoRadioList('thumb_watermark', 'class="inputbox"', $params->thumb_watermark); ?></td>
    </tr>
    <tr>
      <td class="pl20 pt10"><?php echo _C_JOIGALLERY_CONF_IMG_WATERMARK_POSITION ?></td>
      <td class="pt10"><?php echo mosHTML::selectList($list['watermak_position'] , 'thumb_watermark_position', 'class="inputbox"', 'value', 'text', $params->thumb_watermark_position); ?></td>
    </tr>    
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>    
  </table>

  <input type="hidden" name="option" value="<?php echo $option; ?>" />
  <input type="hidden" name="task" value="thumbuild" />
  <input type="hidden" name="act" value="thumbs" />   
  <input type="hidden" name="hidemainmenu" value="0" />
<input type="hidden" name="boxchecked" value="1" />  

</form>

<script type="text/javascript">
  //Объявляем правила для полей:
  //1.class="numeric" (только цифры)
  $('.numeric').numeric();
  //2.class="numeric_dot" (только цифры и ".")
  //$('.numeric_dot').numeric({allow:"."});

  $(document).ready(function() {
    //Средние эскизы
    $('input#settings_resized').change( function (){
      if($(this).is(':checked'))//alert("OK");
            $(".settings_resized").css("display", 'block');
      else  $(".settings_resized").fadeOut("slow");
    })

    //Мини-эскизы
    $('input#settings_thumb').change( function (){
      if($(this).is(':checked'))//alert("OK");
            $(".settings_thumb").css("display", 'block');
      else  $(".settings_thumb").fadeOut("slow");
    })

  });
</script>